package com.wxs.config;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class AnnotationPointcut {

    @Before("execution(* com.wxs.service.UserServiceImp.*(..))")
    public void before(){
        System.out.println("---------annotation方法执行前---------");
    }

    @After("execution(* com.wxs.service.UserServiceImp.*(..))")
    public void after(){
        System.out.println("---------annotation方法执行后---------");
    }

    @Around("execution(* com.wxs.service.UserServiceImp.*(..))")
    public void around(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("around before------");
        Object proceed = joinPoint.proceed();
        System.out.println("------around after");
        System.out.println("return value is :" + proceed);
    }
}
